package com.example.jc.netty


/**
 * XiaoYao,万家灯火 华灯初上
 * @Description:
 * @Author: 肖垚 1094890313@qq.com
 * @create: 2021年11月19日 17:26
 * @Version 1.0
 **/
public class SocketEndClient {
//
//    fun main(args: Array<String>) {
//        val host = args[0]
//        val port = args[1].toInt()
//        val workerGroup: EventLoopGroup = NioEventLoopGroup()
//        try {
//            val b = Bootstrap() // (1)
//            b.group(workerGroup) // (2)
//            b.channel(NioSocketChannel::class.java) // (3)
//            b.option(ChannelOption.SO_KEEPALIVE, true) // (4)
//            b.handler(object : ChannelInitializer<SocketChannel>() {
//                @Throws(Exception::class)
//                override fun initChannel(ch: SocketChannel) {
//                    ch.pipeline().addLast(TimeClientHandler())
//                }
//            })
//
//            // Start the client.
//            val f: ChannelFuture = b.connect(host, port).sync() // (5)
//
//            // Wait until the connection is closed.
//            f.channel().closeFuture().sync()
//        } finally {
//            workerGroup.shutdownGracefully()
//        }
//    }
}